package file;

import java.io.File;
import java.io.IOException;

public class CreateNewFileDome {
    public static void main(String[] args) {
        File file = new File("test.txt");
        System.out.println(file.getName());
        if (!file.exists()){
            try {
               file.createNewFile();
                System.out.println("文件已创建");
                return;
            } catch (Exception e) {}
        }
        System.out.println("文件已存在");
        //file.mkdirs();
        file.delete();
        System.out.println("文件已删除");

    }
}
